package cn.cxq.learning.e6;

import java.util.Scanner;

public class Client {

    public static void main(String[] args) {

        JordanElimination jordanElimination = new JordanElimination();

        int N;

        Scanner scanner = new Scanner(System.in);

        N = scanner.nextInt();

        for (int x = 0; x < N; x++) {
            for (int i = 0; i < jordanElimination.MM; i++) {
                for (int j = 0; j < jordanElimination.MN; j++) {
                    jordanElimination.A[i][j] = scanner.nextDouble();
                }
            }
            jordanElimination.Jordan();
            for (int i = 0; i < jordanElimination.MM; i++) {
                System.out.print(String.format("%.9f ", jordanElimination.A[i][jordanElimination.MN - 1]));
                if (i == 3) {
                    System.out.println();
                }
            }
        }
    }
}
